<template>
	<el-dialog :visible.sync="options.showDialog" width="600px" class="evalDialog">
		<h3 class="declare-title">{{options.title}}</h3>
		<div class="declare-content">
			<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea">
			</el-input>
			<el-button type="primary" size="small" style="width: 80px;margin-top: 20px;" @click="submit">提交</el-button>
		</div>
		
	</el-dialog>
</template>

<script>
export default{
	props:{
		options:{require: true,type: Object},
	},
	data(){
		return{
			textarea: '',									//内容
		}
	},
	methods:{
		/* 提交文本内容 */
		submit(){
			if(!this.textarea){
				this.$message({
					message: '文本信息不能为空！',
					type: 'warning'
				})
				return false;
			}
			this.$emit(this.options.eventName,this.textarea);
		}
	},
	watch:{
		'options.showDialog'(){
			if(!this.options.showDialog){
				this.textarea = '';
			}
		}
	}
}
</script>

<style scoped="scoped">
.declare-title{line-height: 60px;font-size: 18px;letter-spacing: 2px;font-weight: bold;padding: 10px 0 0 0;text-align: center;}
.declare-content{width: 500px;margin: 0 auto;text-align: center;padding-bottom: 20px;}
</style>
